home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / Processes.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  6.5 KB  |  252 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Processes.a
  3. ;
  4. ;    Contains:    Process Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__PROCESSES__') = 'UNDEFINED' THEN
  21. __PROCESSES__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  30.     include 'Events.a'
  31.     ENDIF
  32. ;        include 'Quickdraw.a'                                        ;
  33. ;            include 'MixedMode.a'                                    ;
  34. ;            include 'QuickdrawText.a'                                ;
  35. ;        include 'OSUtils.a'                                        ;
  36. ;            include 'Memory.a'                                        ;
  37.  
  38.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  39.     include 'Files.a'
  40.     ENDIF
  41. ProcessSerialNumber     RECORD    0
  42. highLongOfPSN             ds.l   1        ; offset: $0 (0)
  43. lowLongOfPSN             ds.l   1        ; offset: $4 (4)
  44. sizeof                     EQU *            ; size:   $8 (8)
  45.                         ENDR
  46.  
  47. ; typedef struct ProcessSerialNumber  ProcessSerialNumber, *ProcessSerialNumberPtr
  48.  
  49. ; Process identifier - Various reserved process serial numbers 
  50. kNoProcess                        EQU        0
  51. kSystemProcess                    EQU        1
  52. kCurrentProcess                    EQU        2
  53.  
  54. ; Definition of the parameter block passed to _Launch
  55. ;    Typedef and flags for launchControlFlags field 
  56. ; typedef unsigned short     LaunchFlags
  57.  
  58. ; Definition of the parameter block passed to _Launch 
  59. launchContinue                    EQU        $4000
  60. launchNoFileFlags                EQU        $0800
  61. launchUseMinimum                EQU        $0400
  62. launchDontSwitch                EQU        $0200
  63. launchAllow24Bit                EQU        $0100
  64. launchInhibitDaemon                EQU        $0080
  65.  
  66. ; Format for first AppleEvent to pass to new process.  The size of the overall
  67. ;  buffer variable: the message body immediately follows the messageLength 
  68. AppParameters             RECORD    0
  69. theMsgEvent                 ds     EventRecord ; offset: $0 (0)
  70. eventRefCon                 ds.l   1        ; offset: $10 (16)
  71. messageLength             ds.l   1        ; offset: $14 (20)
  72. sizeof                     EQU *            ; size:   $18 (24)
  73.                         ENDR
  74.  
  75. ; typedef struct AppParameters  AppParameters, *AppParametersPtr
  76. ; Parameter block to _Launch 
  77. LaunchParamBlockRec     RECORD    0
  78. reserved1                 ds.l   1        ; offset: $0 (0)
  79. reserved2                 ds.w   1        ; offset: $4 (4)
  80. launchBlockID             ds.w   1        ; offset: $6 (6)
  81. launchEPBLength             ds.l   1        ; offset: $8 (8)
  82. launchFileFlags             ds.w   1        ; offset: $C (12)
  83. launchControlFlags         ds.w   1        ; offset: $E (14)
  84. launchAppSpec             ds.l   1        ; offset: $10 (16)
  85. launchProcessSN             ds     ProcessSerialNumber ; offset: $14 (20)
  86. launchPreferredSize         ds.l   1        ; offset: $1C (28)
  87. launchMinimumSize         ds.l   1        ; offset: $20 (32)
  88. launchAvailableSize         ds.l   1        ; offset: $24 (36)
  89. launchAppParameters         ds.l   1        ; offset: $28 (40)
  90. sizeof                     EQU *            ; size:   $2C (44)
  91.                         ENDR
  92.  
  93. ; typedef struct LaunchParamBlockRec  LaunchParamBlockRec, *LaunchPBPtr
  94. ; Set launchBlockID to extendedBlock to specify that extensions exist.
  95. ; Set launchEPBLength to extendedBlockLen for compatibility.
  96.  
  97. ; Definition of the information block returned by GetProcessInformation 
  98. modeDeskAccessory                EQU        $00020000
  99. modeMultiLaunch                    EQU        $00010000
  100. modeNeedSuspendResume            EQU        $00004000
  101. modeCanBackground                EQU        $00001000
  102. modeDoesActivateOnFGSwitch        EQU        $00000800
  103. modeOnlyBackground                EQU        $00000400
  104. modeGetFrontClicks                EQU        $00000200
  105. modeGetAppDiedMsg                EQU        $00000100
  106. mode32BitCompatible                EQU        $00000080
  107. modeHighLevelEventAware            EQU        $00000040
  108. modeLocalAndRemoteHLEvents        EQU        $00000020
  109. modeStationeryAware                EQU        $00000010
  110. modeUseTextEditServices            EQU        $00000008
  111. modeDisplayManagerAware            EQU        $00000004
  112.  
  113. ; Record returned by GetProcessInformation 
  114. ProcessInfoRec             RECORD    0
  115. processInfoLength         ds.l   1        ; offset: $0 (0)
  116. processName                 ds.l   1        ; offset: $4 (4)
  117. processNumber             ds     ProcessSerialNumber ; offset: $8 (8)
  118. processType                 ds.l   1        ; offset: $10 (16)
  119. processSignature         ds.l   1        ; offset: $14 (20)
  120. processMode                 ds.l   1        ; offset: $18 (24)
  121. processLocation             ds.l   1        ; offset: $1C (28)
  122. processSize                 ds.l   1        ; offset: $20 (32)
  123. processFreeMem             ds.l   1        ; offset: $24 (36)
  124. processLauncher             ds     ProcessSerialNumber ; offset: $28 (40)
  125. processLaunchDate         ds.l   1        ; offset: $30 (48)
  126. processActiveTime         ds.l   1        ; offset: $34 (52)
  127. processAppSpec             ds.l   1        ; offset: $38 (56)
  128. sizeof                     EQU *            ; size:   $3C (60)
  129.                         ENDR
  130.  
  131. ; typedef struct ProcessInfoRec  ProcessInfoRec, *ProcessInfoRecPtr
  132. ;
  133. ; pascal OSErr LaunchApplication(LaunchPBPtr LaunchParams)
  134. ;
  135.     IF ¬ GENERATINGCFM THEN
  136.         ; parameters: 
  137.         ;     LaunchParams      => A0
  138.         ; returns: 
  139.         ;     OSErr             <= D0
  140.         _LaunchApplication:    OPWORD    $A9F2
  141.     ELSE
  142.         IMPORT_CFM_FUNCTION    LaunchApplication
  143.     ENDIF
  144.  
  145. ;
  146. ; pascal OSErr LaunchDeskAccessory(const FSSpec *pFileSpec, ConstStr255Param pDAName)
  147. ;
  148.     IF ¬ GENERATINGCFM THEN
  149.         Macro
  150.         _LaunchDeskAccessory
  151.             move.w    #$0036,-(sp)
  152.             dc.w     $A88F
  153.         EndM
  154.     ELSE
  155.         IMPORT_CFM_FUNCTION    LaunchDeskAccessory
  156.     ENDIF
  157.  
  158. ;
  159. ; pascal OSErr GetCurrentProcess(ProcessSerialNumber *PSN)
  160. ;
  161.     IF ¬ GENERATINGCFM THEN
  162.         Macro
  163.         _GetCurrentProcess
  164.             move.w    #$0037,-(sp)
  165.             dc.w     $A88F
  166.         EndM
  167.     ELSE
  168.         IMPORT_CFM_FUNCTION    GetCurrentProcess
  169.     ENDIF
  170.  
  171. ;
  172. ; pascal OSErr GetFrontProcess(ProcessSerialNumber *PSN)
  173. ;
  174.     IF ¬ GENERATINGCFM THEN
  175.         Macro
  176.         _GetFrontProcess
  177.             dc.w     $70FF
  178.             dc.w     $2F00
  179.             move.w    #$0039,-(sp)
  180.             dc.w     $A88F
  181.         EndM
  182.     ELSE
  183.         IMPORT_CFM_FUNCTION    GetFrontProcess
  184.     ENDIF
  185.  
  186. ;
  187. ; pascal OSErr GetNextProcess(ProcessSerialNumber *PSN)
  188. ;
  189.     IF ¬ GENERATINGCFM THEN
  190.         Macro
  191.         _GetNextProcess
  192.             move.w    #$0038,-(sp)
  193.             dc.w     $A88F
  194.         EndM
  195.     ELSE
  196.         IMPORT_CFM_FUNCTION    GetNextProcess
  197.     ENDIF
  198.  
  199. ;
  200. ; pascal OSErr GetProcessInformation(const ProcessSerialNumber *PSN, ProcessInfoRec *info)
  201. ;
  202.     IF ¬ GENERATINGCFM THEN
  203.         Macro
  204.         _GetProcessInformation
  205.             move.w    #$003A,-(sp)
  206.             dc.w     $A88F
  207.         EndM
  208.     ELSE
  209.         IMPORT_CFM_FUNCTION    GetProcessInformation
  210.     ENDIF
  211.  
  212. ;
  213. ; pascal OSErr SetFrontProcess(const ProcessSerialNumber *PSN)
  214. ;
  215.     IF ¬ GENERATINGCFM THEN
  216.         Macro
  217.         _SetFrontProcess
  218.             move.w    #$003B,-(sp)
  219.             dc.w     $A88F
  220.         EndM
  221.     ELSE
  222.         IMPORT_CFM_FUNCTION    SetFrontProcess
  223.     ENDIF
  224.  
  225. ;
  226. ; pascal OSErr WakeUpProcess(const ProcessSerialNumber *PSN)
  227. ;
  228.     IF ¬ GENERATINGCFM THEN
  229.         Macro
  230.         _WakeUpProcess
  231.             move.w    #$003C,-(sp)
  232.             dc.w     $A88F
  233.         EndM
  234.     ELSE
  235.         IMPORT_CFM_FUNCTION    WakeUpProcess
  236.     ENDIF
  237.  
  238. ;
  239. ; pascal OSErr SameProcess(const ProcessSerialNumber *PSN1, const ProcessSerialNumber *PSN2, Boolean *result)
  240. ;
  241.     IF ¬ GENERATINGCFM THEN
  242.         Macro
  243.         _SameProcess
  244.             move.w    #$003D,-(sp)
  245.             dc.w     $A88F
  246.         EndM
  247.     ELSE
  248.         IMPORT_CFM_FUNCTION    SameProcess
  249.     ENDIF
  250.  
  251.     ENDIF ; __PROCESSES__
  252.